NFS3 and iSCSI automation tests; Fix for NFS Cancel Maintenance#66
NFS3 and iSCSI automation tests; Fix for NFS Cancel Maintenance#66sandeeplocharla wants to merge 7 commits into
Conversation
19bcfc3 to
e656893
Compare
96b40d9 to
9bf2bc7
Compare
9bf2bc7 to
a2cd65e
Compare
There was a problem hiding this comment.
Pull request overview
This pull request adds a comprehensive Marvin-based integration test suite for the NetApp ONTAP primary storage plugin, covering NFS3 and iSCSI workflows end-to-end (pool lifecycle, volume lifecycle, and VM attach/detach), along with supporting documentation and a convenience runner script.
Changes:
- Added 10 ONTAP integration test suites (NFS3 + iSCSI) with a shared
OntapTestBase+ ONTAP REST verification client. - Added documentation (README + full test-case matrix) and a
run_tests.shwrapper to execute suites by tag. - Added an
ontap.cfgconfiguration file for test environments (needs scrubbing before merge).
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/integration/plugins/ontap/TEST_CASES.md | Adds a detailed test-case reference matrix for all ONTAP suites. |
| test/integration/plugins/ontap/run_tests.sh | Adds a tag-driven runner to execute each suite file sequentially and summarize results. |
| test/integration/plugins/ontap/README.md | Documents test layout, prerequisites, configuration, and execution patterns. |
| test/integration/plugins/ontap/ontap.cfg | Provides a Marvin config for ONTAP tests (currently contains real-looking credentials/IPs). |
| test/integration/plugins/ontap/ontap_test_base.py | Introduces shared base class, ONTAP REST client, and common helpers/cleanup. |
| test/integration/plugins/ontap/init.py | Package initializer for the ONTAP test plugin directory. |
| test/integration/plugins/ontap/nfs3/init.py | Package initializer for NFS3 tests. |
| test/integration/plugins/ontap/nfs3/pool/init.py | Package initializer for NFS3 pool suites. |
| test/integration/plugins/ontap/nfs3/pool/test_pool_lifecycle.py | Adds NFS3 pool lifecycle workflow tests and ONTAP-side assertions. |
| test/integration/plugins/ontap/nfs3/pool/test_pool_with_volumes.py | Adds NFS3 pool lifecycle tests with a live volume present (incl. cancel-maintenance behavior checks). |
| test/integration/plugins/ontap/nfs3/pool/test_zone_scoped_pool.py | Adds zone-scoped NFS3 pool tests including host connectivity/export-policy assertions. |
| test/integration/plugins/ontap/nfs3/volume/init.py | Package initializer for NFS3 volume suites. |
| test/integration/plugins/ontap/nfs3/volume/test_volume_lifecycle.py | Adds NFS3 volume lifecycle tests (CS metadata semantics) and negative delete coverage. |
| test/integration/plugins/ontap/nfs3/instance/init.py | Package initializer for NFS3 instance suites. |
| test/integration/plugins/ontap/nfs3/instance/test_vm_volume_attach.py | Adds NFS3 VM + volume attach/detach lifecycle tests. |
| test/integration/plugins/ontap/iscsi/init.py | Package initializer for iSCSI tests. |
| test/integration/plugins/ontap/iscsi/pool/init.py | Package initializer for iSCSI pool suites. |
| test/integration/plugins/ontap/iscsi/pool/test_pool_lifecycle.py | Adds iSCSI pool lifecycle workflow tests and ONTAP-side assertions (igroups, LUNs). |
| test/integration/plugins/ontap/iscsi/pool/test_pool_with_volumes.py | Adds iSCSI pool lifecycle tests with a live volume (LUN) present. |
| test/integration/plugins/ontap/iscsi/pool/test_zone_scoped_pool.py | Adds zone-scoped iSCSI pool tests including igroup assertions. |
| test/integration/plugins/ontap/iscsi/volume/init.py | Package initializer for iSCSI volume suites. |
| test/integration/plugins/ontap/iscsi/volume/test_volume_lifecycle.py | Adds iSCSI volume lifecycle tests (LUN per CS volume) and negative delete coverage. |
| test/integration/plugins/ontap/iscsi/instance/init.py | Package initializer for iSCSI instance suites. |
| test/integration/plugins/ontap/iscsi/instance/test_vm_volume_attach.py | Adds iSCSI VM + volume attach/detach lifecycle tests with LUN-map assertions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from marvin.cloudstackAPI import ( | ||
| cancelStorageMaintenance, | ||
| createVolume as createVolumeAPI, | ||
| deleteStoragePool as deleteStoragePoolAPI, | ||
| deleteVolume as deleteVolumeAPI, | ||
| listDiskOfferings as listDiskOfferingsAPI, | ||
| updateStoragePool as updateStoragePoolAPI, | ||
| ) |
| "url": "http://10.193.56.65", | ||
| "username": "root", | ||
| "password": "netapp1!" | ||
| } |
| "dbSvr": "10.193.56.62", | ||
| "passwd": "", | ||
| "db": "cloud", | ||
| "port": 3306, | ||
| "user": "root" |
| "mgtSvrIp": "10.193.56.62", | ||
| "port": 8096, | ||
| "user": "admin", | ||
| "passwd": "password", | ||
| "hypervisor": "kvm" |
| "storageIP": "10.196.38.187", | ||
| "svmName": "vs0", | ||
| "username": "admin", | ||
| "password": "netapp1!" | ||
| }, |
a2cd65e to
930ca9e
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated 8 comments.
Comments suppressed due to low confidence (4)
test/integration/plugins/ontap/ontap_test_base.py:39
tearDownClassuses enableStorageMaintenance but it is not imported, so teardown will raise NameError and skip pool cleanup.
from marvin.cloudstackAPI import (
cancelStorageMaintenance,
createVolume as createVolumeAPI,
deleteStoragePool as deleteStoragePoolAPI,
deleteVolume as deleteVolumeAPI,
test/integration/plugins/ontap/ontap.cfg:29
- This config file includes what appears to be a real KVM host password. Please replace with placeholders/sample values so secrets are not committed.
"url": "http://10.193.56.65",
"username": "root",
"password": "netapp1!"
test/integration/plugins/ontap/ontap.cfg:54
- The management server credentials in this committed config should be placeholders/sample values (not real or default admin credentials).
"mgtSvrIp": "10.193.56.62",
"port": 8096,
"user": "admin",
"passwd": "password",
"hypervisor": "kvm"
test/integration/plugins/ontap/ontap.cfg:61
- The ONTAP credentials in this committed config should be placeholders/sample values so secrets are not committed.
"storageIP": "10.196.38.187",
"svmName": "vs0",
"username": "admin",
"password": "netapp1!"
| self._poll_pool_state(pool.id, "Maintenance", timeout=120) | ||
|
|
||
| # Attempt forced=False delete — must raise exception because volumes exist | ||
| with self.assertRaises(Exception): |
| enableStorageMaintenance, | ||
| updateStoragePool as updateStoragePoolAPI, | ||
| ) | ||
| from marvin.lib.base import StoragePool |
| self._poll_pool_state(pool.id, "Maintenance", timeout=120) | ||
|
|
||
| # Attempt forced=False delete — must raise exception because volumes exist | ||
| with self.assertRaises(Exception): |
| Running: | ||
| nosetests --with-marvin \\ | ||
| --marvin-config=test/integration/plugins/ontap/ontap.cfg \\ | ||
| test/integration/plugins/ontap/test_ontap_nfs3_pool_with_volumes.py -v |
| Running: | ||
| nosetests --with-marvin \\ | ||
| --marvin-config=test/integration/plugins/ontap/ontap.cfg \\ | ||
| test/integration/plugins/ontap/test_ontap_zone_scoped_pool.py -v |
| Running: | ||
| nosetests --with-marvin \\ | ||
| --marvin-config=test/integration/plugins/ontap/ontap.cfg \\ | ||
| test/integration/plugins/ontap/test_ontap_vm_volume_attach.py -v |
| Running: | ||
| nosetests --with-marvin \\ | ||
| --marvin-config=test/integration/plugins/ontap/ontap.cfg \\ | ||
| test/integration/plugins/ontap/test_ontap_vm_volume_attach_iscsi.py -v |
| Running: | ||
| nosetests --with-marvin \\ | ||
| --marvin-config=test/integration/plugins/ontap/ontap.cfg \\ | ||
| test/integration/plugins/ontap/test_ontap_iscsi_pool_with_volumes.py -v |
Description
This PR has the following:
Automation tests for NFS3 and iSCSI protocols
Run all 10 suites
Run a single suite by tag
Fix for Cancel maintenance not functioning properly in case of NFS3
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?